package com.chb.service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.chb.entity.Ttt;
import com.chb.mapper.TttMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.aop.framework.AopContext;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
 * @description:
 * @author: CHB
 * @create: 2021-11-22 15:50
 **/
@Slf4j
@Service
public class TttService extends ServiceImpl<TttMapper,Ttt> {

    public void insertData(){
        new TttService().afterInsert();
        TttService o = (TttService)AopContext.currentProxy();
        o.afterInsert();
    }

    @Transactional(rollbackFor = Exception.class)
    public void afterInsert(){
        log.info("do something");

    }
}
